﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Project32CHE.Biz.Goods.Extend.Model;

namespace Project32CHE.Biz.Goods.Extend.Providers
{
    /// <summary>
    /// 未实现的单据适配器类
    /// </summary>
    public abstract class AbstractProvider
    {
        /// <summary>
        /// 单据类型，一般用于BizType
        /// </summary>
        public abstract string Type { get; }
        /// <summary>
        /// 单据Id
        /// </summary>
        public Guid Id { get; private set; }

        internal void ChangeId(Guid id)
        {
            this.Id = id;
        }
        internal InventorySheet Process(params object[] parameters)
        {
            return this.ProcessCore(parameters);
        }
        internal InventorySheet UnProcess(params object[] parameters)
        {
            return this.UnProcessCore(parameters);
        }

        /// <summary>
        /// 根据单据读取配件信息
        /// </summary>
        /// <returns></returns>
        protected abstract InventorySheet ProcessCore(params object[] parameters);
        /// <summary>
        /// 根据单据读取信息，反结算专用
        /// </summary>
        /// <returns></returns>
        protected abstract InventorySheet UnProcessCore(params object[] parameters);
    }
}
